/*
 * $Id: Main.m,v 1.1 2005-11-20 11:11:31 bacon Exp $
 */

#include "MainApp.h"
#include "Globals.h"
#include <xp/bas/stdio.h>

static int __xp_main (int argc, xp_char_t* argv[]);

int xp_main (int argc, xp_char_t* argv[])
{
	int n;

	if (xp_log_open (&app_log,
		APP_NAME, XP_LOG_CONSOLE | XP_LOG_DEBUG) == XP_NULL) {
		xp_fprintf (xp_stderr, XP_TEXT("cannot open log. aborting"));
		n = -1;
	}
	else {
		n = __xp_main (argc, argv);
		xp_log_close (&app_log);
	}

	return n;
}


static int __xp_main (int argc, xp_char_t* argv[])
{
	MainApp* app;

	app = [[MainApp alloc] init];	
	[app run];
	[app dealloc];
	return 0;
}
